package iraunkortasuna;

import java.io.*;

public class Nagusia {

	
	public static void main (String [] args){
		
		PertsonaIraunkor p1 = new PertsonaIraunkor(12345, "Pernando Amezketarra");
		PertsonaIraunkor p2 = new PertsonaIraunkor(12345, "Ioana Gorri");
		
		PertsonenZerrenda pz = new PertsonenZerrenda();
		pz.txertatu(p1);
		pz.txertatu(p2);
		
		 try {
			   FileOutputStream fs = new FileOutputStream("pertsonak.ser");
			   ObjectOutputStream os = new ObjectOutputStream(fs);
			   os.writeObject(pz);
			   os.close();
			}catch (Exception ex){
			  ex.printStackTrace();
			}
	}
	
}
